using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class OrderProductMap : EntityTypeConfiguration<OrderProduct>
    {
        public OrderProductMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            // Table & Column Mappings
            this.ToTable("OrderProduct");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.OrderId).HasColumnName("OrderId");
            this.Property(t => t.ProductId).HasColumnName("ProductId");
            this.Property(t => t.PurchaseId).HasColumnName("PurchaseId");
            this.Property(t => t.WorksheetId).HasColumnName("WorksheetId");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.SendAmount).HasColumnName("SendAmount");
            this.Property(t => t.Price).HasColumnName("Price").HasPrecision(18, 8); ;
            this.Property(t => t.FinalPrice).HasColumnName("FinalPrice").HasPrecision(18, 8); ;
            this.Property(t => t.CostPrice).HasColumnName("CostPrice").HasPrecision(18, 8); ;
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.PrimaryID).HasColumnName("PrimaryID");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.PriceTime).HasColumnName("PriceTime");
            this.Property(t => t.Progress).HasColumnName("Progress");
        }
    }
}
